package com.yz.controller;



import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.yz.common.annotation.Login;
import com.yz.common.annotation.LoginUser;
import com.yz.common.entity.*;
import com.yz.common.utils.R;
import com.yz.form.ChangeNameForm;
import com.yz.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.annotations.ApiIgnore;

import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 项目相关操作
 *
 * @author yz电风扇

 *
 */
@RestController
@RequestMapping("/api")
@Api(tags="项目")
public class ApiProjectController {
    @Autowired
    private ProjectService projectService;


    @GetMapping("getUnfinishProject")
    @ApiOperation("获取未完成项目")
    @Login
    public R getUnfinishProject(@RequestHeader("token")String token,@RequestParam(value = "keyWord",required = false) String keyWord,@ApiIgnore @LoginUser UserEntity user) {//先从人员关联表中获取项目id，再从项目表获取项目
        try {
            return R.ok().put("data", projectService.getUnfinishProject(keyWord,user));
        } catch (Exception e) {
            return R.error().put("data", null);
        }
    }
}
